(function (lib, img, cjs) { var p; // shortcut to reference prototypes // library properties: lib.properties = { width: 900, height: 550, fps: 24, color: "#FFFFFF", manifest: [] }; // symbols: (lib.tick = function() { this.initialize(); // Layer 1 this.shape = new cjs.Shape(); this.shape.graphics.f("#33FF00").s().p("AlDIzQhxh9gPgMQg5gwgigaQg9gvgegGQh2gWgbgJQgmgNAAglQAAgWASgTQATgVAZAAQC4AAClCGQAxAnBEBFQBCBDAVAQQCIk0C5kLQCjjrCqihQCbiUBogiQBpghAABlQAAAIhBA4IihCNQkHDuiSDKQhrCWhzEbQgvBxgVAlQgiA5gfAAQgkAAhyh2g"); this.shape.setTransform(81.8,68.2); this.addChild(this.shape); }).prototype = p = new cjs.Container(); p.nominalBounds = new cjs.Rectangle(0,0,163.5,136.4); (lib.reset = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_0 = function() { this.stop(); } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(2)); // Layer 2 this.shape = new cjs.Shape(); this.shape.graphics.f("rgba(102,102,102,0.996)").s().p("AjXNKQjdg7ininQhFhEgxhOQinkMAokyQAEgaAFgaQARhRAbhRIAIgKQAkhXAxhEQCljqEKhZQCag3CzAGIANAFICiAaQA4ASA4AZQCAA5BtBaIEKjqIAEMOIsEhzIEfj6QgPgYgagPQgjgVgfgPQhHgihLgOQh7gWh2AbQghAHgcAKQhUAehOAzIgGALIgLACQh3Blg8CRQgUAwgLArQACAGgCAHIgFAaQgbC4BTCoQBdC4C3BZQBOAnBYAKQAbAAARAJQBOABBIgMQAxgIAxgSQCYg4Bfh+IAegfQAFgLAHgIQAFgEACgHQAMgqAngTID5AnQAIAhgXAeIgEAGQgYA0goA6QgpBIhFBFQhJBIhPAsIgJALIg0AYIgFAJQgbAHgaAMQg6Aag7AQQgoAJgeAFIg4AHQg5AIg1AAQhqAAhkgbg"); this.shape.setTransform(20.2,462.9); this.shape_1 = new cjs.Shape(); this.shape_1.graphics.f("rgba(204,204,204,0.996)").s().p("AjXNKQjdg7ininQhFhEgxhOQinkMAokyQAEgaAFgaQARhRAbhRIAIgKQAkhXAxhEQCljqEKhZQCag3CzAGIANAFICiAaQA4ASA4AZQCAA5BtBaIEKjqIAEMOIsEhzIEfj6QgPgYgagPQgjgVgfgPQhHgihLgOQh7gWh2AbQghAHgcAKQhUAehOAzIgGALIgLACQh3Blg8CRQgUAwgLArQACAGgCAHIgFAaQgbC4BTCoQBdC4C3BZQBOAnBYAKQAbAAARAJQBOABBIgMQAxgIAxgSQCYg4Bfh+IAegfQAFgLAHgIQAFgEACgHQAMgqAngTID5AnQAIAhgXAeIgEAGQgYA0goA6QgpBIhFBFQhJBIhPAsIgJALIg0AYIgFAJQgbAHgaAMQg6Aag7AQQgoAJgeAFIg4AHQg5AIg1AAQhqAAhkgbg"); this.shape_1.setTransform(20.2,462.9); this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape}]}).to({state:[{t:this.shape_1}]},1).wait(1)); // Layer 1 this.shape_2 = new cjs.Shape(); this.shape_2.graphics.f("#FFFFFF").s().p("ApdIHQj7jYAAkvQAAkuD7jYQD7jYFiAAQFiAAD8DYQD7DYAAEuQAAEvj7DYQj8DYliAAQliAAj7jYgAnlkeQgyASgdA/QglBLABB6IgEAkQgCAlAHAbQAXBXBnAAQAyAAAWgoQANgYAAgbQAAghgVgYQgVgZAAgcQAAgVAdhOQAehOAAgLQAAgtgkgXQgVgPgYAAQgQAAgRAHg"); this.shape_2.setTransform(20.4,464.3); this.timeline.addTween(cjs.Tween.get(this.shape_2).wait(2)); }).prototype = p = new cjs.MovieClip(); p.nominalBounds = new cjs.Rectangle(-65.5,376,171.7,173.8); (lib.cross = function() { this.initialize(); // Layer 1 this.shape = new cjs.Shape(); this.shape.graphics.f("#FF0000").s().p("AoVGtQgIgPAAgSQAAgbC6jFQCmitBVhOIBKhAQhAg0hGgnQg6gfhGgQQgagGhSgLQg2gJgUgLQgbgRAAglQAAhSBZADQBLABCAA+QBuA2BtBPIAzAkQBJg6BEgpIA9grQBBgrA0gZQCihNAAB8QAAAXg8ApQgjAZhxBEQhcA3hMAyQA6A/CaCdQCQCeAAAuQAAAbgJASQgQAeglAAQhDAAiDinQiHi/glgtIgZgcQhHA0gyAqIjaDoQiuC5gfAAQgnAAgPgeg"); this.shape.setTransform(54.3,46); this.addChild(this.shape); }).prototype = p = new cjs.Container(); p.nominalBounds = new cjs.Rectangle(0,0,108.5,92); (lib.bar = function() { this.initialize(); // Layer 1 this.shape = new cjs.Shape(); this.shape.graphics.lf(["#999999","#EEEEEE","#CCCCCC"],[0,0.522,1],0,-28,0,28).s().p("EhGXADlIAAnKMCMvAAAIAAHKg"); this.shape.setTransform(450.5,23); this.addChild(this.shape); }).prototype = p = new cjs.Container(); p.nominalBounds = new cjs.Rectangle(0,0,900.9,46); (lib.hit = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_0 = function() { /* stop();*/ } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1)); // Layer 1 this.gapTxt = new cjs.Text("decode", "22px 'Century Gothic'", "#666666"); this.gapTxt.name = "gapTxt"; this.gapTxt.textAlign = "center"; this.gapTxt.lineHeight = 24; this.gapTxt.lineWidth = 217; this.gapTxt.setTransform(-2,-15.1); this.shape = new cjs.Shape(); this.shape.graphics.f().s("#666666").ss(2,1,1).p("AyBivMAkDAAAIAAFfMgkDAAAg"); this.shape_1 = new cjs.Shape(); this.shape_1.graphics.f("#FFFFFF").s().p("AyBCwIAAlfMAkDAAAIAAFfg"); this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape},{t:this.gapTxt}]}).wait(1)); }).prototype = p = new cjs.MovieClip(); p.nominalBounds = new cjs.Rectangle(-116.4,-18.6,232.9,37.2); (lib.gapDrag = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_0 = function() { /* stop();*/ } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1)); // Layer 1 this.gapTxt = new cjs.Text("decode", "22px 'Century Gothic'", "#666666"); this.gapTxt.name = "gapTxt"; this.gapTxt.textAlign = "center"; this.gapTxt.lineHeight = 24; this.gapTxt.lineWidth = 217; this.gapTxt.setTransform(-2,-15.1); this.shape = new cjs.Shape(); this.shape.graphics.f().s("#666666").ss(2,1,1).p("AyBivMAkDAAAIAAFfMgkDAAAg"); this.shape_1 = new cjs.Shape(); this.shape_1.graphics.f("#FFFFFF").s().p("AyBCwIAAlfMAkDAAAIAAFfg"); this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape},{t:this.gapTxt}]}).wait(1)); }).prototype = p = new cjs.MovieClip(); p.nominalBounds = new cjs.Rectangle(-116.4,-18.6,232.9,37.2); // stage content: (lib.AlgorithmsKeyWords = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_0 = function() { var startTxt = "Hit all the words that relate to this topic."; var right = ["flowchart", "process", "input", "output"]; var wrong = ["monitor", "megabyte", "laptop", "HTML"]; this.title2.textBaseline = "middle"; this.title2.y = this.title2.y+21; this.title2.font="28px Century Gothic,Futura,Arial"; this.title.textBaseline = "middle"; this.title.y = this.title.y+21; this.title.font="28px Century Gothic,Futura,Arial"; createjs.Touch.enable(stage); var shuffle = new Array; var wordPos = 80; var words = new Array; var direct = [false, false, false, false, false, false, false, false]; var timing = [7, 8, 3, 9, 4, 10, 5, 6]; var score = 0; var wrongCount = 0; this.tick.visible = false; this.cross.visible = false; var that = this; this.feedback.font = "bold 22px Century Gothic,Futura,Arial"; this.feedback.color = "#0099FF"; stage.enableMouseOver(10); setupHit(); function setupHit() { that.feedback.text = startTxt; var allWords = right.concat(wrong); while (allWords.length > 0) { shuffle.push(allWords.splice(Math.round(Math.random() * (allWords.length - 1)), 1)[0]); } for (var o = 0; o < shuffle.length; o++) { var word = new lib.hit(); word.gapTxt.text = shuffle[o]; word.gapTxt.font="22px Century Gothic,Futura,Arial"; word.x = 125; word.y = wordPos; stage.addChild(word); word.gapTxt.mouseEnabled = false; word.buttonMode = true; word.on("mousedown", checkWord); wordPos = wordPos + 45; words.push(word); } createjs.Ticker.addEventListener("tick", tick); } function tick(){ for (var t = 0; t < words.length; t++) { if (words[t].x > 780) { direct[t] = true; } else if (words[t].x < 125) { direct[t] = false; } if (direct[t]==false) { words[t].x = words[t].x + timing[t]; } else { words[t].x = words[t].x - timing[t]; } } } function checkWord(event) { for (var g = 0; g < right.length; g++) { if (event.currentTarget.gapTxt.text == right[g]) { score++; } } for (var h = 0; h < right.length; h++) { if (event.currentTarget.gapTxt.text == wrong[h]) { wrongCount++; } } if (score==right.length) { that.feedback.text="Well done, you've found all the words!"; that.tick.visible=true; clearHit(); } else if (wrongCount>1) { that.feedback.text="Sorry you've hit too many wrong words, try again."; that.cross.visible=true; clearHit(); } else { } event.currentTarget.visible=false; } function clearHit() { for (var l = 0; l < words.length; l++) { stage.removeChild(words[l]); } } this.reset.buttonMode = true; this.reset.addEventListener("click", resetGame.bind(this)); this.reset.addEventListener("mouseover", resetOver.bind(this)); this.reset.addEventListener("mouseout", resetOut.bind(this)); function resetOver() { that.reset.alpha = .5; } function resetOut() { that.reset.alpha = 1; } function resetGame(event) { clearHit(); wordPos = 80; score=0; wrongCount=0; direct = [false,false,false,false,false,false,false,false]; that.tick.visible=false; that.cross.visible=false; shuffle = []; words = []; setupHit(); } } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1)); // actions this.reset = new lib.reset(); this.reset.setTransform(941.4,424.1,0.294,0.294,0,0,0,307,307); this.timeline.addTween(cjs.Tween.get(this.reset).wait(1)); // btns this.reset_1 = new lib.reset(); this.reset_1.setTransform(858.4,471.3,0.294,0.294,0,0,0,1.4,4.9); this.timeline.addTween(cjs.Tween.get(this.reset_1).wait(1)); // titles this.title2 = new cjs.Text("KS3 COMPUTING", "32px 'Century Gothic'", "#333333"); this.title2.name = "title2"; this.title2.textAlign = "center"; this.title2.lineHeight = 34; this.title2.lineWidth = 885; this.title2.setTransform(447.5,505.4); this.title = new cjs.Text("Algorithms", "32px 'Century Gothic'", "#333333"); this.title.name = "title"; this.title.lineHeight = 32; this.title.lineWidth = 810; this.title.setTransform(5,2.4); this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.title},{t:this.title2}]}).wait(1)); // bg this.instance = new lib.bar(); this.instance.setTransform(449.5,527.4,1,1,180,0,0,450.4,23); this.instance_1 = new lib.bar(); this.instance_1.setTransform(449.4,23.4,1,1,0,0,0,450.4,23); this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.instance_1},{t:this.instance}]}).wait(1)); // activities this.feedback = new cjs.Text("Drag the labels onto the correct flowchart symbols.", "22px 'Century Gothic'", "#666666"); this.feedback.name = "feedback"; this.feedback.lineHeight = 20; this.feedback.lineWidth = 724; this.feedback.setTransform(4.5,439.2); this.cross = new lib.cross(); this.cross.setTransform(778.8,470.4,0.521,0.543,0,0,0,54.3,46); this.tick = new lib.tick(); this.tick.setTransform(778.7,470.4,0.388,0.34,0,0,0,81.8,68.2); this.shape = new cjs.Shape(); this.shape.graphics.f().s("#666666").ss(1,1,1).p("EBGUAAAMiMnAAA"); this.shape.setTransform(450,433.6); this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape},{t:this.tick},{t:this.cross},{t:this.feedback}]}).wait(1)); }).prototype = p = new cjs.MovieClip(); p.nominalBounds = new cjs.Rectangle(449,275.4,902,631.3); })(lib = lib||{}, images = images||{}, createjs = createjs||{}); var lib, images, createjs;